class sdu::wn {
   $condor_pkg = [
      "condor",
      "condor-classads",
      "condor-kbdd",
      "condor-procd",
      "condor-python",
      "condor-external-libs",
     ]


  package { $condor_pkg:
              ensure  => installed,
              require => Yumrepo['site'],
  } ->
  package {"condor-worker":
    ensure     => absent,
  } ->
  #file {"/etc/condor/wrapper":
  #  ensure     =>  directory,
  #  mode       =>  '0755',
  #  owner      =>  'root',
  #  group      =>  'root',
  #} ->
  #file {"/etc/condor/wrapper/wrapper.sh":
  #  mode       =>  '0755',
  #  owner      =>  'root',
  #  group      =>  'root',
  #  source     =>  "puppet:///modules/${module_name}/wrapper.sh",
  #  notify   => Exec['refreshcondorwn']
  #} ->
  file {"/etc/condor/config.d/01-startd.conf":
    mode       =>  '0644',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/01-startd.conf",
    notify   => Exec['refreshcondorwn']
  } ->
  file {"/etc/condor/config.d/02-startd-hard.conf":
    mode       =>  '0644',
    owner      =>  'root',
    group      =>  'root',
    source     =>  "puppet:///modules/${module_name}/02-startd-hard.conf",
    notify   => Exec['restart_condor_wn']
  } ->
  service { 'condor':
    ensure     => 'running',
    enable     => true,
    hasrestart => true,
    hasstatus  => true,
  }
  exec {'restart_condor_wn':
    command      => "/sbin/service condor restart",
    refreshonly  => true
  }
  exec {'refreshcondorwn':
    command      => "/usr/sbin/condor_reconfig",
    refreshonly  => true
  }
  file {'/scratch':
    ensure   => link,
    force  => true,
    target   => "/tmp",
  }
}
